import http from "@/utils/http";
import axios from "axios";
const rangeMange = {
    //  上传镜像
    upload: (data: any) => axios.post("/api/range/uploadTargetRange", data, {
        headers: { "Content-Type": "multipart/form-data" }
    }),
    //查询
    list: (data: any) => {
        return http.get("/range/listPage", data);
    },
    // 高级多条件分页查询
    searchPage: (params: {
        pageNum?: number,
        pageSize?: number,
        rangeName?: string,
        rangeType?: string,
        difficultyId?: number,
        exposePort?: number,
        rangeDesc?: string,
        updater?: string,
        uploader?: string
    }) => {
        return http.get("/range/listPage", { params });
    },
    // 删除
    delete: (rangeId: string) => {
        return http.delete(`/range/deleteTargetRange/${rangeId}`);
    },
    //修改
    update: (data: any) => {
        return http.put("/range/update", data);
    },
// 分页查询
    listPage: (data: any) => {
        return http.get("/range/listPage", data);
    },
//     查询题目难易度
    queryLevel: (data: any) => {
        return http.get("/range/getdifficulty", data);
    },
//     查询难易度
    queryLevelList: () => {
        return http.get("/range/getdifficultylist");
    },
}
export default rangeMange;